package com.sanerzone.smscenter.gateway.web;

import com.alibaba.rocketmq.client.producer.DefaultMQProducer;
import com.google.common.collect.Maps;

import java.util.Date;
import java.util.Map;

/**
 * Created by yy on 2018/3/28.
 */
public class Test {
    public static void main(String args[]) throws Exception{
        Map<String,Object> map = Maps.newHashMap();
        map.put("aa","3.12");
        Object b = map.get("bb");
        Object massSpeedObject = map.get("aa");
        if (null != massSpeedObject && Double.parseDouble(massSpeedObject.toString()) > 0) {
            Double d = Double.parseDouble(massSpeedObject.toString());
            System.out.println("ddddddddddddddddddd");
        }
            System.out.println(b);
//        DefaultMQProducer defaultMQProducer = new DefaultMQProducer();
        final DefaultMQProducer producer = new DefaultMQProducer(
                "ProducerGroupName");
        //nameserver服务,多个以;分开
//        producer.setNamesrvAddr("127.0.0.1:9876");
        producer.setNamesrvAddr("120.26.166.161:9876");
        producer.setInstanceName("Producer");

        String top = "SMSSRV2";
        String key = "65254D0000002A9F000000000004E176";
        int maxnum = 10;
        long begin = new Date().getTime()-(2 * 3600 * 1000);
        long end = new Date().getTime() + (2 * 3600 * 1000);
//        QueryResult queryResult =producer.queryMessage(top,key,maxnum,begin,end);
//        System.out.println(queryResult);
    }
}
